Editions
MetadataViews.Editions
Editions MetadataView returns the following:
- infoList: Array
- name: string - The name of the edition
- number: string - The edition number
- max : string - The max number of moments are minted
import Golazos from 0xGOLAZOSADDRESS
import MetadataViews from 0xMETADATAVIEWSADDRESS
pub fun main(address: Address, id: UInt64): MetadataViews.Editions {
let account = getAccount(address)
let collectionRef = account.getCapability(Golazos.CollectionPublicPath)
.borrow<&{Golazos.MomentNFTCollectionPublic}>()
?? panic("Could not borrow capability from public collection")
let nft = collectionRef.borrowMomentNFT(id: id)
?? panic("Couldn't borrow momentNFT")
return nft.resolveView(Type<MetadataViews.Editions>())! as! MetadataViews.Editions
}